<!DOCTYPE html>
<html>
    
    <head>
       <meta charset="UTF-8">
        {include="style"}
		<style>
		.layui-form-pane .layui-form-label {
			width: 150px;
			}
		.layui-form-pane .layui-form-item[pane] .layui-input-inline {
			margin-left: 150px;
		}
		</style>
    </head>
    
    <body>
	 <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>系统扩展</cite></a>
              <a><cite>模型管理</cite></a>
              <a><cite>修改模型</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="iconfont" style="line-height:30px">&#xe6aa;</i></a>
        </div>
        <div class="x-body">
            <form class="layui-form layui-form-pane" >
			<input type="hidden" name="go" value="1" />
			<input type="hidden" name="id" value="{$data['id']}" />
			<input type="hidden" name="sys" value="{$data['sys']}" />
			
			
			
                <div class="layui-form-item">
                    <label for="name" class="layui-form-label">
                        <span class="x-red">*</span>模型名称
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="name" value="{$data['name']}"   name="name" required="" lay-verify="required"
                        autocomplete="off" class="layui-input">
                    </div>
                </div>
				
				 <div class="layui-form-item">
                    <label for="biaoshi" class="layui-form-label">
                        <span class="x-red">*</span>模型标识
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="biaoshi" value="{$data['biaoshi']}"   name="biaoshi" 
                        autocomplete="off" class="layui-input">
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  <span class="x-red">*</span>必须是英文字母，且不能是已存在的标识，标识即是数据库里的表名
				    </div>
                </div>
				
				 <div class="layui-form-item" pane>
                    <label for="ismust" class="layui-form-label">
                        <span class="x-red"></span>是否必选栏目
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="ismust" value="0" title="不是" {if($data['ismust']==0)}checked{/if}>
						<input type="radio" name="ismust" value="1" title="是" {if($data['ismust']==1)}checked{/if}>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  <span class="x-red">*</span>
					  新增修改内容时必选
				    </div>
					
                 </div>
				 <div class="layui-form-item" pane>
                    <label for="isclasstype" class="layui-form-label">
                        <span class="x-red"></span>是否显示栏目
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="isclasstype" value="0" title="不是" {if($data['isclasstype']==0)}checked{/if}>
						<input type="radio" name="isclasstype" value="1" title="是" {if($data['isclasstype']==1)}checked{/if}>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  <span class="x-red">*</span>
					  列表展示、录入内容、修改内容三个页面是否展示栏目
				    </div>
					
                 </div>
				 <div class="layui-form-item" pane>
                    <label for="iscontrol" class="layui-form-label">
                        <span class="x-red"></span>是否受权限控制
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="iscontrol" value="0" title="否" {if($data['iscontrol']==0)}checked{/if}>
						<input type="radio" name="iscontrol" value="1" title="是" {if($data['iscontrol']==1)}checked{/if}>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  <span class="x-red">*</span>
					  不同角色可以通过控制栏目权限来限制查看内容
				    </div>
					
                 </div>
				<div class="layui-form-item" pane>
                    <label for="isshowclass" class="layui-form-label">
                        <span class="x-red"></span>栏目绑定显示
                    </label>
                    <div class="layui-input-inline">
					
					<input type="radio" name="isshowclass" value="0" title="不是" {if($data['isshowclass']==0)}checked{/if}>
					<input type="radio" name="isshowclass" value="1" title="是" {if($data['isshowclass']==1)}checked{/if}>
					
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  <span class="x-red">*</span>
					  栏目绑定时是否显示该模型
				    </div>
					
                 </div>
				<div class="layui-form-item">
                    <label for="list_html" class="layui-form-label">
                        <span class="x-red">*</span>列表模板
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="list_html" value="{$data['list_html']}"    name="list_html" 
                        autocomplete="off" class="layui-input">
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  <span class="x-red">*</span>默认列表模板
				    </div>
                </div>
				<div class="layui-form-item">
                    <label for="details_html" class="layui-form-label">
                        <span class="x-red">*</span>详情模板
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="details_html" value="{$data['details_html']}"    name="details_html" 
                        autocomplete="off" class="layui-input">
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  <span class="x-red">*</span>默认详情模板
				    </div>
                </div>
				 
				 
				<div class="layui-form-item" pane>
                    <label for="isopen" class="layui-form-label">
                        <span class="x-red"></span>是否开启
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="isopen" value="0" title="不显示" {if($data['isopen']==0)}checked{/if}>
						<input type="radio" name="isopen" value="1" title="显示" {if($data['isopen']==1)}checked{/if}>
                    </div>
					 
					
                </div>
				
				

                <div class="layui-form-item" style="text-align:center;">
                    
                     <button  class="layui-btn" lay-filter="save" lay-submit="">
                        保存
                    </button>
                </div>
            </form>
        </div>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
      
        <script>
            layui.use(['laydate','form','layer','upload'], function(){
                $ = layui.jquery;
              var form = layui.form
              ,layer = layui.layer;
			  laydate = layui.laydate;
		
             
			  
			    //监听提交
              form.on('submit(save)', function(data){
                //console.log(data);
                //发异步，把数据提交给php
				$.post("{fun U('Molds/editMolds')}",data.field,function(r){
					
					var r = JSON.parse(r);
					if(r.code==0){
						 layer.msg(r.msg, {icon: 6,time: 2000},function () {
							// 获得frame索引
							{if($webconf['admintpl']=='tpl')}
							 window.location.href="{fun U('Molds/index')}";
							{else}
							parent.location.reload();
							{/if}
							
						});
					}else{
						layer.alert(r.msg, {icon: 5});
					}
				});
				
               
                return false;
              });
            

           
              
              
            });
        </script>
      
    </body>

</html>